package com.esri.core.tasks.ags.geoprocessing;

import com.esri.core.internal.tasks.TaskListener;
import com.esri.core.internal.tasks.d;
import com.esri.core.io.EsriServiceException;
import com.esri.core.io.UserCredentials;

/* loaded from: classes.dex */
abstract class GPTask<T> extends d<T> {
    private static final long serialVersionUID = 1;
    protected GPMessage[] _messages;

    public GPTask(GPTaskParameters gPTaskParameters, String str, UserCredentials userCredentials) {
        this(gPTaskParameters, str, userCredentials, null);
    }

    public GPTask(GPTaskParameters gPTaskParameters, String str, UserCredentials userCredentials, TaskListener<T> taskListener) {
        super(gPTaskParameters, str, userCredentials, taskListener);
        if (gPTaskParameters == null) {
            throw new EsriServiceException("The geoprocess task requires input parameters");
        }
        if (!gPTaskParameters.validate()) {
            throw new EsriServiceException("The geoprocess task parameter validation fails");
        }
    }

    public synchronized GPMessage[] getMessages() {
        return this._messages;
    }

    public GPServiceInfo getServiceInfo() {
        return ((GPTaskParameters) getActionInput()).getServiceInfo();
    }

    public GPTaskInfo getTaskInfo() {
        return ((GPTaskParameters) getActionInput()).getTaskInfo();
    }
}
